package com.group3.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.group3.entity.LiveRoom;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface LiveRoomMapper extends BaseMapper<LiveRoom> {
    @Select("SELECT lr.* FROM live_room lr " +
            "JOIN user_interest ui ON lr.id = ui.live_id " +
            "WHERE ui.user_id = #{userId} " +
            "ORDER BY lr.start_time DESC LIMIT #{limit}")
    List<LiveRoom> findRecommendedRooms(Long userId, int limit);
}
